<!DOCTYPE HTML>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="css.css" />
		<script src="js.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<div class="box">
			<div>
				<table border="0" cellspacing="1" cellpadding="0">
					<thead id="th">
						<tr>
							<td><input type="checkbox" id="inp" />全选</td>
							<td>商品名称</td>
							<td>单价</td>
							<td>数量</td>
							<td>小计</td>
							<td>操作</td>
						</tr>
					</thead>
					<tbody id="tb">
					</tbody>
				</table>
			</div>
		</div>
		<script type="text/javascript">
			var tb = document.getElementById("tb");
			tb.innerHTML = "";
			var trs = "";
			for (var i = 0; i < arr.length; i++) {
				trs += "<tr>"+
							"<td>"+"<input type='checkbox'/>"+"</td>"+
							"<td>"+arr[i].goodsName+"</td>"+
							"<td>"+arr[i].price+"元"+"</td>"+
							"<td>"+"<input type='number' value='1'/>"+"</td>"+
							"<td>"+"39元"+"</td>"+
							"<td>"+"<button>X</button>"+"</td>"+
						"</tr>"
			}
			tb.innerHTML = trs;
		</script>
	</body>
</html>
